this._screencastInProgress = false;
this._screencastSupported = false;
+ this._currentMode = UIMode.SCREENSHOT;
this._screencastProxy = new ScreencastProxy(
Gio.DBus.session,
}
this._screencastSupported = this._screencastProxy.ScreencastSupported;
- this._castButton.visible = this._screencastSupported;
+ this._syncCastButton();
});
this._screencastProxy.connectSignal('Error',
_sessionUpdated() {
this.close(true);
- this._castButton.reactive = Main.sessionMode.allowScreencast;
+ }
+
+ _syncCastButton() {
+ const visible = this._screencastSupported;
+ const reactive = visible &&
+ this._currentMode !== UIMode.SCREENSHOT_ONLY &&
+ Main.sessionMode.allowScreencast;
+
+ this._castButton.set({visible, reactive});
}
_syncWindowButtonSensitivity() {
if (mode === UIMode.SCREENCAST && !this._screencastSupported)
return;
+ this._currentMode = mode;
this._castButton.checked = mode === UIMode.SCREENCAST;
- this._castButton.reactive = mode !== UIMode.SCREENSHOT_ONLY;
+ this._syncCastButton();
if (!this.visible) {
// Screenshot UI is opening from completely closed state